App({

  /**
   * 当小程序初始化完成时，会触发 onLaunch（全局只触发一次）
   */
  onLaunch: function(option) {
    console.log(option.scene)
  },

  /**
   * 当小程序启动，或从后台进入前台显示，会触发 onShow
   */
  onShow: function(options) {

  },

  /**
   * 当小程序从前台进入后台，会触发 onHide
   */
  onHide: function() {

  },

  /**
   * 当小程序发生脚本错误，或者 api 调用失败时，会触发 onError 并带上错误信息
   */
  onError: function(msg) {

  },

  globalData: {
    isBgAudioPlay: false, //背景音乐控制
    /**
     * https://developers.themoviedb.org/3/configuration/get-api-configuration
     * Our current limits are 40 requests every 10 seconds and are limited by IP address, not API key.
     * 从tmdb取的配置项，这里静态配置，参考文档，隔几天应该重新更新一下
     * 调用api，获取参数 https://api.themoviedb.org/3/configuration?api_key=02cbcaac4c0f567976a208a4f943793c
     * movie的poster地址 = base_url+poster_sizes+img
     */
    tmdb_config: {
      base_url: "http://image.tmdb.org/t/p/",
      poster_sizes: "w342"
    },
    tmdb_api_key_v3: "02cbcaac4c0f567976a208a4f943793c",
    tmdb_multi_search_url: "https://api.themoviedb.org/3/search/movie",
    tmdb_movie_url: "https://api.themoviedb.org/3/movie/",
    tmdb_query_url: [{
      title: "正在热映",
      queryUrl: "https://api.themoviedb.org/3/discover/movie?sort_by=primary_release_date.desc&vote_average.gte=6&vote_count.gte=250"
    }, {
      title: "即将上映",
      queryUrl: "https://api.themoviedb.org/3/discover/movie?sort_by=primary_release_date.asc&with_original_language=en"
    }, {
      title: "vote top",
      queryUrl: "https://api.themoviedb.org/3/discover/movie?sort_by=vote_average.desc&vote_count.gte=3000"
    }]
  }
})